package com.immortal.core.module.version.core;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

/**
 * <p>spring boot专用，避免继承webconfigurationsupport对spring的自动配置侵入和破坏
 *
 * @author wind
 * @version 1.0
 * @since 2018/12/19
 */
@ConditionalOnProperty(prefix = "spring.mvc.version", value = "enabled", havingValue = "true")
@Configuration
public class VersionWebMvcRegistrations implements WebMvcRegistrations {
    @Override
    public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
        return new CustomRequestMappingHandlerMapping();
    }
}
